﻿//flash代码开始
function writeflashhtml(arg) {

    var parm = []
    var _default_version = "9.0.0";
    var _default_quality = "high";
    var _default_align = "middle";
    var _default_menu = "false";

    for (i = 0; i < arguments.length; i++) {
        parm[i] = arguments[i].split(' ').join('').split('=')
        for (var j = parm[i].length - 1; j > 1; j--) {
            parm[i][j - 1] += "=" + parm[i].pop();
        }
        switch (parm[i][0]) {
            case '_version': var _version = parm[i][1]; break;
            case '_swf': var _swf = parm[i][1]; break;
            case '_base': var _base = parm[i][1]; break;
            case '_quality': var _quality = parm[i][1]; break;
            case '_loop': var _loop = parm[i][1]; break;
            case '_bgcolor': var _bgcolor = parm[i][1]; break;
            case '_wmode': var _wmode = parm[i][1]; break;
            case '_play': var _play = parm[i][1]; break;
            case '_menu': var _menu = parm[i][1]; break;
            case '_scale': var _scale = parm[i][1]; break;
            case '_salign': var _salign = parm[i][1]; break;
            case '_height': var _height = parm[i][1]; break;
            case '_width': var _width = parm[i][1]; break;
            case '_hspace': var _hspace = parm[i][1]; break;
            case '_vspace': var _vspace = parm[i][1]; break;
            case '_align': var _align = parm[i][1]; break;
            case '_class': var _class = parm[i][1]; break;
            case '_id': var _id = parm[i][1]; break;
            case '_name': var _name = parm[i][1]; break;
            case '_style': var _style = parm[i][1]; break;
            case '_declare': var _declare = parm[i][1]; break;
            case '_flashvars': var _flashvars = parm[i][1]; break;
            case '_ChannelID': var _ChannelID = parm[i][1]; break;
            case '_TopicID': var _TopicID = parm[i][1]; break;
            default: ;
        }
    }
    var thtml = ""
    thtml += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + ((_version) ? _version : _default_version) + "'"
    if (_width) thtml += " width='" + _width + "'"
    if (_height) thtml += " height='" + _height + "'"
    if (_hspace) thtml += " hspace='" + _hspace + "'"
    if (_vspace) thtml += " vspace='" + _vspace + "'"
    if (_align) thtml += " align='" + _align + "'"
    else thtml += " align='" + _default_align + "'"
    if (_class) thtml += " class='" + _class + "'"
    if (_id) thtml += " id='" + _id + "'"
    if (_name) thtml += " name='" + _name + "'"
    if (_style) thtml += " style='" + _style + "'"
    if (_declare) thtml += " " + _declare
    thtml += ">"
    if (_swf) thtml += "<param name='movie' value='" + _swf + "'>"
    if (_quality) thtml += "<param name='quality' value='" + _quality + "'>"
    else thtml += "<param name='quality' value ='" + _default_quality + "'>"
    if (_loop) thtml += "<param name='loop' value='" + _loop + "'>"
    if (_bgcolor) thtml += "<param name='bgcolor' value='" + _bgcolor + "'>"
    if (_play) thtml += "<param name='play' value='" + _play + "'>"
    if (_menu) thtml += "<param name='menu' value='" + _menu + "'>"
    else thtml += "<param name='menu' value='" + _default_menu + "'>"
    if (_scale) thtml += "<param name='scale' value='" + _scale + "'>"
    if (_salign) thtml += "<param name='salign' value='" + _salign + "'>"
    if (_wmode) thtml += "<param name='wmode' value='" + _wmode + "'>"
    if (_base) thtml += "<param name='base' value='" + _base + "'>"
    if (_flashvars) thtml += "<param name='flashvars' value='" + _flashvars + "'>"
    thtml += "<embed pluginspage='http://www.macromedia.com/go/getflashplayer'"
    if (_width) thtml += " width='" + _width + "'"
    if (_height) thtml += " height='" + _height + "'"
    if (_hspace) thtml += " hspace='" + _hspace + "'"
    if (_vspace) thtml += " vspace='" + _vspace + "'"
    if (_align) thtml += " align='" + _align + "'"
    else thtml += " align='" + _default_align + "'"
    if (_class) thtml += " class='" + _class + "'"
    if (_id) thtml += " id='" + _id + "'"
    if (_name) thtml += " name='" + _name + "'"
    if (_style) thtml += " style='" + _style + "'"
    thtml += " type='application/x-shockwave-flash'"
    if (_declare) thtml += " " + _declare
    if (_swf) thtml += " src='" + _swf + "'"
    if (_quality) thtml += " quality='" + _quality + "'"
    else thtml += " quality='" + _default_quality + "'"
    if (_loop) thtml += " loop='" + _loop + "'"
    if (_bgcolor) thtml += " bgcolor='" + _bgcolor + "'"
    if (_play) thtml += " play='" + _play + "'"
    if (_menu) thtml += " menu='" + _menu + "'"
    else thtml += " menu='" + _default_menu + "'"
    if (_scale) thtml += " scale='" + _scale + "'"
    if (_salign) thtml += " salign='" + _salign + "'"
    if (_wmode) thtml += " wmode='" + _wmode + "'"
    if (_base) thtml += " base='" + _base + "'"
    if (_flashvars) thtml += " flashvars='" + _flashvars + "'"
    if (_ChannelID) thtml += " ChannelID='" + _ChannelID + "'"
    if (_TopicID) thtml += " TopicID='" + _TopicID + "'"
    thtml += "></embed>"
    thtml += "</object>"
    document.write(thtml)
}

//flash代码结束

//获取屏幕高度
function getBrowserHeight() 
{ 
    return (window.innerHeight?window.innerHeight:document.documentElement.clientHeight); 
}
function getObjectHeight(id) 
{ 
return document.getElementById(id).offsetHeight; 
}

//预装载图片代码开始
//<body onLoad="loadImages('bus.gif','busline2.gif','1.gif','2.gif','3.gif','4.gif','5.gif')">
function loadImages() {
    var d = document;
    if (d.images) {
        if (!d.MM_p)
            d.MM_p = new Array();
        var i, j = d.MM_p.length,
         a = loadImages.arguments;
        for (i = 0; i < a.length; i++)
            if (a[i].indexOf("#") != 0) {
            d.MM_p[j] = new Image;
            d.MM_p[j++].src = a[i];
        }
    }
}
//预装载图片代码结束

//插入上传附件
function addUploadItem(type,path){
	var EditType="FCkEditor"
	
	try{
	  var oEditor = parent.FCKeditorAPI.GetInstance('ctl00_plhContent_ctl00_Description_Input')
//	  var hrefLen=location.href.lastIndexOf("/")
//      var Fhref=location.href.substr(0,hrefLen+1)
//      path=Fhref+path
	}
	catch(e){
	}
	type=type.toLowerCase()
 	 switch(type){
 	  case 'gif':
        oEditor.InsertHtml('<img src="'+path+'" alt=""/>')
 	  	break;
 	  case 'jpg':
        oEditor.InsertHtml('<img src="'+path+'" alt=""/>')
 	  	break;
 	  case 'png':
        oEditor.InsertHtml('<img src="'+path+'" alt=""/>')
 	  	break;
 	  case 'bmp':
        oEditor.InsertHtml('<img src="'+path+'" alt=""/>')
 	  	break;
 	  case 'jpeg':
        oEditor.InsertHtml('<img src="'+path+'" alt=""/>')
 	  	break;
 	  case 'mp3':
        oEditor.InsertHtml('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"  id="MediaPlayer" width="450" height="70"><param name=""howStatusBar" value="-1"><param name="AutoStart" value="False"><param name="Filename" value="'+path+'"></object>')
 	  	break;
 	  case 'wma':
        oEditor.InsertHtml('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"  id="MediaPlayer" width="450" height="70"><param name=""howStatusBar" value="-1"><param name="AutoStart" value="False"><param name="Filename" value="'+path+'"></object>')
 	  	break;
 	  case 'rm':
        oEditor.InsertHtml('<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="300"><param name="SRC" value="'+path+'" /><param name="CONTROLS" VALUE="ImageWindow" /><param name="CONSOLE" value="one" /><param name="AUTOSTART" value="true" /><embed src="'+path+'" nojava="true" controls="ImageWindow" console="one" width="400" height="300"></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="32" /><param name="CONTROLS" value="StatusBar" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+path+'" nojava="true" controls="StatusBar" console="one" width="400" height="24" /></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="32" /><param name="CONTROLS" value="ControlPanel" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+path+'" nojava="true" controls="ControlPanel" console="one" width="400" height="24" autostart="true" loop="false" /></object>')
 	  	break;
 	  case 'rmvb':
        oEditor.InsertHtml('<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="300"><param name="SRC" value="'+path+'" /><param name="CONTROLS" VALUE="ImageWindow" /><param name="CONSOLE" value="one" /><param name="AUTOSTART" value="true" /><embed src="'+path+'" nojava="true" controls="ImageWindow" console="one" width="400" height="300"></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="32" /><param name="CONTROLS" value="StatusBar" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+path+'" nojava="true" controls="StatusBar" console="one" width="400" height="24" /></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="32" /><param name="CONTROLS" value="ControlPanel" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+path+'" nojava="true" controls="ControlPanel" console="one" width="400" height="24" autostart="true" loop="false" /></object>')
 	  	break;
 	  case 'ra':
        oEditor.InsertHtml('<object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" id="RAOCX" width="450" height="60"><param name="_ExtentX" value="6694"><param name="_ExtentY" value="1588"><param name="AUTOSTART" value="true"><param name="SHUFFLE" value="0"><param name="PREFETCH" value="0"><param name="NOLABELS" value="0"><param name="SRC" value="'+path+'"><param name="CONTROLS" value="StatusBar,ControlPanel"><param name="LOOP" value="0"><param name="NUMLOOP" value="0"><param name="CENTER" value="0"><param name="MAINTAINASPECT" value="0"><param name="BACKGROUNDCOLOR" value="#000000"><embed src="'+path+'" width="450" autostart="true" height="60"></embed></object>')
 	  	break;
 	  case 'asf':
        oEditor.InsertHtml('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" standby="Loading..." width="400" height="300"><param name="FileName" VALUE="'+path+'" /><param name="ShowStatusBar" value="-1" /><param name="AutoStart" value="true" /><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+path+'" autostart="true" width="400" height="300" /></object>')
 	  	break;
 	  case 'avi':
        oEditor.InsertHtml('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" standby="Loading..." width="400" height="300"><param name="FileName" VALUE="'+path+'" /><param name="ShowStatusBar" value="-1" /><param name="AutoStart" value="true" /><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+path+'" autostart="true" width="400" height="300" /></object>')
 	  	break;
 	  case 'wmv':
        oEditor.InsertHtml('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" standby="Loading..." width="400" height="300"><param name="FileName" VALUE="'+path+'" /><param name="ShowStatusBar" value="-1" /><param name="AutoStart" value="true" /><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+path+'" autostart="true" width="400" height="300" /></object>')
 	  	break;
 	  case 'swf':
        oEditor.InsertHtml('<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="300"><param name="movie" value="'+path+'" /><param name="quality" value="high" /><param name="AllowScriptAccess" value="never" /><embed src="'+path+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="300" /></object>')
 	  	break;
 	  default :
        break;
     }
}

function CheckNull(strNameID, strNameMsg) {
    var objName = document.getElementById(strNameID);
    if (objName.value == "") {
        alert(strNameMsg);
        objName.focus();
        return false;
    }
}

function KeyDown() {
    if (event.keyCode == 13) {
        event.returnValue = false;
        event.cancel = true;
        gosearch();
    }
}

//搜索
function gosearch(){
    var keyword = document.getElementById("tbxSearch").value;
    if(keyword!="" && keyword!="search"){
        var url = "http://www.google.com.hk/search?sitesearch=www.adnewsun.com&hl=zh-CN&ie=UTF-8&q=" + keyword;
        window.open(url);
    }
}
function gosearchkey(keyword) {
    if (keyword != "" && keyword != "search") {
        window.location.href = "http://www.google.com.hk/search?sitesearch=www.adnewsun.com&hl=zh-CN&ie=UTF-8&q=" + keyword;
    }
}
function HomeBoxIN(boxid) {
    var box = document.getElementById(boxid);
    box.className = "boxheader_on";
}
function HomeBoxOUT(boxid) {
    var box = document.getElementById(boxid);
    box.className = "boxheader_off";
}
function BannerIN(obj) {
    obj.className = "current";
}
function BannerOUT(obj) {
    obj.className = "";
}
function showfont(obj, title) {
    obj.style.backgroundImage = "url(../images/channel_box_bg.gif)";
    obj.innerHTML = title;
}
function showpic(obj, pic) {
    obj.style.backgroundImage = "url(" + pic + ")";
    obj.innerHTML = "";
}